﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

using Microsoft.SharePoint.Administration;


namespace TweakSP.Web.ContentService
{
    [System.Runtime.InteropServices.Guid("9CDA865A-04CF-4b9c-AF08-9861D589BB37")]
    public class TweakSP_ContentService : SPService
    {
        #region SPService

        private static TweakSP_ContentService local = null;

        public static TweakSP_ContentService Local
        {
            get
            {
                if (TweakSP_ContentService.local == null)
                {
                    TweakSP_ContentService.local =
                      SPFarm.Local.Services.GetValue<TweakSP_ContentService>("TweakSP_ContentService");
                }

                return TweakSP_ContentService.local;
            }
        }

        public TweakSP_ContentService() { ;}
        public TweakSP_ContentService(SPFarm farm)
            : base("TweakSP_ContentService", farm)
        { }

        #endregion

        [Persisted]
        private bool databaseTweaksEnabled;

        public bool DatabaseTweaksEnabled
        {
            get
            {
                return this.databaseTweaksEnabled;
            }
            set
            {
                this.databaseTweaksEnabled = value;
                this.Update();
            }
        }


    }
}
